import React, { Component } from 'react'

export default class SideBar extends Component {

  render() {
    return (
      <ul>
        {
          this.props.category.map(item => {
            const cls = this.props.currentCategoryId === item.id ? "category-item active" : "category-item";
            return <li key={item.id} className={cls} onClick={this.props.onItemClick.bind(this, item.id)}>{item.title}</li>
          })
        }
      </ul>
    )
  }
}
